package com.one.consumer.reserve.ui.binder;

import android.support.annotation.NonNull;
import android.view.View;

import com.one.common.config.RouterPath;
import com.one.common.manager.RouterManager;
import com.one.common.view.multitytype.adapter.BaseItemBinder;
import com.one.common.view.multitytype.adapter.BaseViewHolderMulti;
import com.one.consumer.R;
import com.one.common.common.order.extra.ReserveExtra;
import com.one.consumer.reserve.model.item.CustomProjectItem;

/**
 * author ：zhulunjun
 * email  ：zhulunjun@qq.com
 * date   ：2018/10/21 下午10:12
 * description ：项目列表
 **/
public class CustomProjectBinder extends BaseItemBinder<CustomProjectItem> {
    public CustomProjectBinder() {
        super(R.layout.item_custom_project);
    }

    @Override
    protected void bindView(@NonNull BaseViewHolderMulti holder, @NonNull CustomProjectItem item) {
        holder.setText(R.id.tv_project_name, item.getCustomized_name());

        holder.getView(R.id.ll_custom_project).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                ReserveExtra extra = new ReserveExtra(ReserveExtra.STYLE_CU, item.getCustomized_id() + "");
                extra.getCustomExtra().setProjectId(item.getCustomized_id()+"");
                extra.getCustomExtra().setProjectName(item.getCustomized_name());
                RouterManager.getInstance().go(RouterPath.CASE_LIST,extra);
            }
        });
    }
}
